package
{
	import com.xcopy.Screen;
	import flash.display.MovieClip;
	import flash.events.Event;

	public class Slot25SlotLine extends Screen
	{
		protected var lines:Array = [];
		protected var items:Array = [];
		protected var info:Array  = [];

		public function Slot25SlotLine(r:* = null)
		{
			super(r);
		}

		override public function set clip(mc:MovieClip):void
		{
			super.clip = mc;
			var i:Number = 0;
			var j:Number = 0;
			var mc_i:MovieClip;
			var mc_j:MovieClip;
			for (i = 0; i < 25; i++)
			{
				mc_i = clip.getChildByName('oLine' + (i + 1)) as MovieClip;
				lines[i] = mc_i;
				lines[i].visible = false;
				items[i] = [];
				for (j = 0; j < 5; j++)
				{
					mc_j = lines[i].getChildByName('oFrame' + (j + 1)) as MovieClip;
					items[i][j] = mc_j;
				}
			}
		}

		public function clearLine():void
		{
			var i:Number = 0;
			for (i = 0; i < 25; i++)
			{
				lines[i].visible = false;
			}
		}

		public function singleLine(index:Number):void
		{
			var i:Number = 0;
			var j:Number = 0;
			for (i = 0; i < 25; i++)
			{
				lines[i].visible = false;
				if (info[i] > 0 && i == index)
				{
					lines[i].visible = true;
					for (j = 0; j < 5; j++)
					{
						if (j < info[i])
						{
							items[i][j].gotoAndStop('Frame');
						}
						else
						{
							items[i][j].gotoAndStop('Line');
						}
					}
				}
			}
		}

		public function showLine(info:Array):void
		{
			var i:Number = 0;
			var j:Number = 0;
			this.info = info;
			for (i = 0; i < 25; i++)
			{
				if (info[i] > 0)
				{
					lines[i].visible = true;
					for (j = 0; j < 5; j++)
					{
						items[i][j].gotoAndStop('Line');
					}
				}
			}
		}
	}
}
